package org.ccay.core.registry;

import java.io.Serializable;

/**
 * 注册项
 *
 */
public class RegistryItem implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -2463974983659182342L;
	/**
	 * 名称 使用类似与java包的命名方式定义名称
	 */
	private String name;
	/**
	 * 值
	 */
	private String value;

	/**
	 * 描述
	 */
	private String desc;
	
	/**
	 * 是否可覆盖（表示是否可以在允许在运行时可修改及可被改写）
	 */
	private boolean overwritable = false;
	
	
	public RegistryItem() {
	}
	
	public RegistryItem(String name, String value, String desc, boolean overwritable) {
		this.name = name;
		this.value = value;
		this.desc = desc;
		this.overwritable = overwritable;
	}
	
	public String getName() {
		return name;
	}
	@Override
	public String toString() {
		return "RegistryItem [name=" + name + ", value=" + value + ", desc=" + desc + ", overwritable=" + overwritable + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RegistryItem other = (RegistryItem) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	public boolean isOverwritable() {
		return overwritable;
	}
	public void setOverwritable(boolean overwritable) {
		this.overwritable = overwritable;
	}
	
}
